package com.yuanwu.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;

@RestController
public class HelloController {
    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }

    @GetMapping("/demo")
    public String get() {

        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
        String str_date = df.format(new Date());// new Date()为获取当前系统时间

        return "<h1>Jenkins自动部署单体SpringBoot项目成功! 现在时间是北京时间：" + str_date + "</h1>";
    }

}
